<html>
<head><meta charset="utf-8"><title>How to run local build of `rustdoc` on a file / crate · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/How.20to.20run.20local.20build.20of.20.60rustdoc.60.20on.20a.20file.20.2F.20crate.html">How to run local build of `rustdoc` on a file / crate</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="217875050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/How%20to%20run%20local%20build%20of%20%60rustdoc%60%20on%20a%20file%20/%20crate/near/217875050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/How.20to.20run.20local.20build.20of.20.60rustdoc.60.20on.20a.20file.20.2F.20crate.html#217875050">(Nov 25 2020 at 11:56)</a>:</h4>
<p>I would like to run my fork of rustdoc on a whole repository. It works for a single file without external dependencies, but I don't know how to invoke it on a file that have dependencies, or on a whole crate. I guess that <code>cargo doc</code> does exactly that, but I didn't figure yet how it does it.</p>
<p>Note: my fork is not build with <code>x.py</code>, but with <code>cargo</code> (It's <code>librustdoc</code> compiled as a binary instead of a lib).</p>



<a name="217875512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/How%20to%20run%20local%20build%20of%20%60rustdoc%60%20on%20a%20file%20/%20crate/near/217875512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/How.20to.20run.20local.20build.20of.20.60rustdoc.60.20on.20a.20file.20.2F.20crate.html#217875512">(Nov 25 2020 at 12:03)</a>:</h4>
<p>If I run it on some file that have external dependencies, I get many errors because my fork cannot find those dependencies.</p>



<a name="217879148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/How%20to%20run%20local%20build%20of%20%60rustdoc%60%20on%20a%20file%20/%20crate/near/217879148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/How.20to.20run.20local.20build.20of.20.60rustdoc.60.20on.20a.20file.20.2F.20crate.html#217879148">(Nov 25 2020 at 12:43)</a>:</h4>
<p>Try setting the env variable RUSTDOC as the path to your binary, then running cargo doc</p>



<a name="217879199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/How%20to%20run%20local%20build%20of%20%60rustdoc%60%20on%20a%20file%20/%20crate/near/217879199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/How.20to.20run.20local.20build.20of.20.60rustdoc.60.20on.20a.20file.20.2F.20crate.html#217879199">(Nov 25 2020 at 12:44)</a>:</h4>
<p>Trying to replicate cargo's build flags is not worth it IMO</p>



<a name="217909031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/How%20to%20run%20local%20build%20of%20%60rustdoc%60%20on%20a%20file%20/%20crate/near/217909031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/How.20to.20run.20local.20build.20of.20.60rustdoc.60.20on.20a.20file.20.2F.20crate.html#217909031">(Nov 25 2020 at 16:41)</a>:</h4>
<p>Perfect, it worked! (or at least it does stuff, I need to work on the visualization part to know if this makes sense).</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>